<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>熙康健康体检系统 - 数据概览</title>
    <!-- 引入ECharts库 -->
    <script src="https://cdn.jsdelivr.net/npm/echarts@5.4.3/dist/echarts.min.js"></script>
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            font-family: 'Microsoft YaHei', sans-serif;
        }
        
        body {
            background-color: #f5f7fa;
            color: #333;
        }
        
        .header {
            background-color: #1a5276;
            color: white;
            padding: 20px 0;
            text-align: center;
            box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
        }
        
        .header h1 {
            font-size: 28px;
            margin-bottom: 10px;
        }
        
        .container {
            max-width: 1400px;
            margin: 30px auto;
            padding: 0 20px;
        }
        
        .stats-cards {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
            gap: 20px;
            margin-bottom: 30px;
        }
        
        .stat-card {
            background-color: white;
            border-radius: 10px;
            padding: 20px;
            box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
            text-align: center;
        }
        
        .stat-card h3 {
            color: #555;
            font-size: 16px;
            margin-bottom: 10px;
        }
        
        .stat-card .value {
            font-size: 28px;
            font-weight: bold;
            color: #1a5276;
            margin-bottom: 5px;
        }
        
        .stat-card .change {
            font-size: 14px;
            color: #27ae60;
        }
        
        .stat-card .change.negative {
            color: #e74c3c;
        }
        
        .chart-container {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(600px, 1fr));
            gap: 30px;
            margin-bottom: 30px;
        }
        
        .chart-card {
            background-color: white;
            border-radius: 10px;
            padding: 20px;
            box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
        }
        
        .chart-card h2 {
            color: #1a5276;
            margin-bottom: 20px;
            font-size: 18px;
            font-weight: 500;
        }
        
        .chart {
            width: 100%;
            height: 400px;
        }
        
        .footer {
            background-color: #2c3e50;
            color: white;
            text-align: center;
            padding: 20px 0;
            margin-top: 50px;
        }
        
        @media (max-width: 768px) {
            .stats-cards {
                grid-template-columns: 1fr;
            }
            
            .chart-container {
                grid-template-columns: 1fr;
            }
            
            .chart {
                height: 300px;
            }
        }
    </style>
</head>
<body>
    <div class="header">
        <h1>熙康健康体检系统</h1>
        <p>数据可视化分析平台</p>
    </div>
    
    <div class="container">
        <div class="stats-cards">
            <div class="stat-card">
                <h3>今日体检人数</h3>
                <div class="value">248</div>
                <div class="change">↑12% 较昨日</div>
            </div>
            
            <div class="stat-card">
                <h3>本月体检人数</h3>
                <div class="value">3,856</div>
                <div class="change">↑8% 较上月</div>
            </div>
            
            <div class="stat-card">
                <h3>年度体检人数</h3>
                <div class="value">28,942</div>
                <div class="change">↑15% 较去年</div>
            </div>
            
            <div class="stat-card">
                <h3>异常检出率</h3>
                <div class="value">18.6%</div>
                <div class="change negative">↓2.4% 较上月</div>
            </div>
        </div>
        
        <div class="chart-container">
            <div class="chart-card">
                <h2>近7天体检人数趋势（折线图）</h2>
                <div id="lineChart" class="chart"></div>
            </div>
            
            <div class="chart-card">
                <h2>体检套餐选择分布（饼图）</h2>
                <div id="pieChart" class="chart"></div>
            </div>
        </div>
        
        <div class="chart-container">
            <div class="chart-card">
                <h2>各分院体检人数对比（柱状图）</h2>
                <div id="barChart" class="chart"></div>
            </div>
            
            <div class="chart-card">
                <h2>年度体检人数累计（面积图）</h2>
                <div id="areaChart" class="chart"></div>
            </div>
        </div>
    </div>
    
    <div class="footer">
        <p>© 2025 熙康健康体检系统 版权所有</p>
    </div>
    
    <script>
        // 初始化所有图表
        document.addEventListener('DOMContentLoaded', function() {
            // 折线图 - 近7天体检人数趋势
            const lineChart = echarts.init(document.getElementById('lineChart'));
            lineChart.setOption({
                tooltip: {
                    trigger: 'axis'
                },
                legend: {
                    data: ['体检人数']
                },
                grid: {
                    left: '3%',
                    right: '4%',
                    bottom: '3%',
                    containLabel: true
                },
                xAxis: {
                    type: 'category',
                    boundaryGap: false,
                    data: ['6月5日', '6月6日', '6月7日', '6月8日', '6月9日', '6月10日', '今日']
                },
                yAxis: {
                    type: 'value'
                },
                series: [
                    {
                        name: '体检人数',
                        type: 'line',
                        data: [320, 302, 341, 374, 390, 450, 480],
                        smooth: true,
                        lineStyle: {
                            width: 3,
                            color: '#3498db'
                        },
                        itemStyle: {
                            color: '#3498db'
                        },
                        areaStyle: {
                            color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
                                { offset: 0, color: 'rgba(52, 152, 219, 0.3)' },
                                { offset: 1, color: 'rgba(52, 152, 219, 0.1)' }
                            ])
                        }
                    }
                ]
            });
            
            // 饼图 - 体检套餐选择分布
            const pieChart = echarts.init(document.getElementById('pieChart'));
            pieChart.setOption({
                tooltip: {
                    trigger: 'item',
                    formatter: '{a} <br/>{b}: {c} ({d}%)'
                },
                legend: {
                    orient: 'vertical',
                    right: 10,
                    top: 'center',
                    data: ['基础套餐', '全面套餐', '精英套餐', '定制套餐']
                },
                series: [
                    {
                        name: '套餐选择',
                        type: 'pie',
                        radius: ['50%', '70%'],
                        avoidLabelOverlap: false,
                        itemStyle: {
                            borderRadius: 10,
                            borderColor: '#fff',
                            borderWidth: 2
                        },
                        label: {
                            show: false,
                            position: 'center'
                        },
                        emphasis: {
                            label: {
                                show: true,
                                fontSize: '18',
                                fontWeight: 'bold'
                            }
                        },
                        labelLine: {
                            show: false
                        },
                        data: [
                            { value: 1048, name: '基础套餐', itemStyle: { color: '#3498db' } },
                            { value: 735, name: '全面套餐', itemStyle: { color: '#2ecc71' } },
                            { value: 580, name: '精英套餐', itemStyle: { color: '#9b59b6' } },
                            { value: 300, name: '定制套餐', itemStyle: { color: '#f39c12' } }
                        ]
                    }
                ]
            });
            
            // 柱状图 - 各分院体检人数对比
            const barChart = echarts.init(document.getElementById('barChart'));
            barChart.setOption({
                tooltip: {
                    trigger: 'axis',
                    axisPointer: {
                        type: 'shadow'
                    }
                },
                grid: {
                    left: '3%',
                    right: '4%',
                    bottom: '3%',
                    containLabel: true
                },
                xAxis: {
                    type: 'value'
                },
                yAxis: {
                    type: 'category',
                    data: ['北京总院', '上海分院', '广州分院', '深圳分院', '成都分院']
                },
                series: [
                    {
                        name: '体检人数',
                        type: 'bar',
                        data: [1250, 980, 850, 720, 600],
                        itemStyle: {
                            color: function(params) {
                                const colorList = ['#1a5276', '#2874a6', '#3498db', '#5dade2', '#85c1e9'];
                                return colorList[params.dataIndex];
                            }
                        },
                        label: {
                            show: true,
                            position: 'right'
                        }
                    }
                ]
            });
            
            // 面积图 - 年度体检人数累计
            const areaChart = echarts.init(document.getElementById('areaChart'));
            areaChart.setOption({
                tooltip: {
                    trigger: 'axis'
                },
                legend: {
                    data: ['体检人数累计']
                },
                grid: {
                    left: '3%',
                    right: '4%',
                    bottom: '3%',
                    containLabel: true
                },
                xAxis: {
                    type: 'category',
                    boundaryGap: false,
                    data: ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月']
                },
                yAxis: {
                    type: 'value'
                },
                series: [
                    {
                        name: '体检人数累计',
                        type: 'line',
                        stack: '总量',
                        areaStyle: {
                            color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
                                { offset: 0, color: 'rgba(58, 77, 233, 0.8)' },
                                { offset: 1, color: 'rgba(58, 77, 233, 0.1)' }
                            ])
                        },
                        emphasis: {
                            focus: 'series'
                        },
                        data: [2200, 4200, 6500, 9000, 11800, 14800, 18200, 21800, 25600, 29600, 33800, 38200]
                    }
                ]
            });
            
            // 窗口大小变化时重新调整图表大小
            window.addEventListener('resize', function() {
                lineChart.resize();
                pieChart.resize();
                barChart.resize();
                areaChart.resize();
            });
        });
    </script>
</body>
</html>
